/*
 *  $Id: BranchTrap.cs 1067 2010-05-21 11:00:43Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Earth.Spells {
    public class BranchTrap: SelfEnchantmentCard {
        public BranchTrap(): base("001_e_s_branch_trap") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Earth;
            Value = 100;
            AddManaCost(ElementType.Earth, 4);
        }

        protected override EnchantmentAffect CreateEnchantment() {
            return new BranchTrapAffect();
        }

        private class BranchTrapAffect: EnchantmentAffect<BranchTrap> {
            public BranchTrapAffect() {
                Add(new BranchTrapAura());
            }
        }

        private class BranchTrapAura: CreatureAuraAffect {
            public BranchTrapAura(): base(false, true) {}

            public override string Id {
                get { return AffectManager.GetCardId<BranchTrap>("aura"); }
            }

            protected override Affect CreateSubAffect() {
                return new BranchTrapAuraAffect();
            }
        }

        private class BranchTrapAuraAffect: SpellAffect<BranchTrap> {
            public BranchTrapAuraAffect() {
                Add(new Affects.AntiFlag<Affects.Flight>());
            }
        }
    }
}
